<template>
    <div class="ec-app-container">
        <el-form ref="categoryForm" :model="category" :rules="categoryRules" label-width="150px">
            <title-container describe= "基本信息"/>
            <el-form-item label="分类名称" prop="name" class="mt-20">
                <el-input v-model="category.name"/>
            </el-form-item>
            <el-form-item label="上级分类" prop="name">
                <el-input v-model="category.pid"/>
                <p>不选择分类默认为顶级分类</p>
            </el-form-item>
            <el-form-item label="数量单位" prop="unitName">
                <el-input v-model="category.unitName"/>
            </el-form-item>
            <el-form-item label="是否显示" prop="ifShow" class="mt-20">
                <el-input v-model="category.ifShow"/>
            </el-form-item>
            <el-form-item label="是否显示导航栏" prop="name">
                <el-input v-model="category.name"/>
            </el-form-item>
            <el-form-item label="分类图标" prop="pictureUrl">
                <el-input v-model="category.pictureUrl"/>
            </el-form-item>
            <el-form-item label="关键词" prop="keyWords">
                <el-input v-model="category.keyWords"/>
            </el-form-item>
            <el-form-item label="分类描述" prop="descInfo" class="mt-20">
                <el-input v-model="category.descInfo"/>
            </el-form-item>
        </el-form>
        <div class="gpo-btn text-center" >
            <el-button type="primary" class="gpo-btn_small" @click="onSubmit">提交</el-button>
            <!--<el-button type="primary" class="gpo-btn_small" @click="onSubmit">立即发布</el-button>-->
        </div>
    </div>
</template>

<script>
    import TitleContainer from '@/components/GpoCommon/TitleContainer'
    export default {
        name: 'createCategory',
        components: {
            TitleContainer
        },
        data() {
            return {
                category: {
                    'pid': '', // 父id
                    'name': '',
                    'unitName': '', // 数量单位名称
                    'sortOrder': 0, // 排序序列
                    'ifShow': 0, // 是否显示：1显示，2不显示
                    'pictureUrl': '', // 图片url
                    'keyWords': '', // 关键词
                    'descInfo': '', // 类别描述信息
                    'dropState': 0, // 0未删除，1已删除
                    'appid': '',
                    'backCategories': '',
                    'cateType': 0,
                    'dataVersion': 0,
                    'leaf': 0,
                    'level': 0,
                    'needAudit': 0, // 是否需要审核 1：是，2：不是
                    'rootCateId': ''
                },
                categoryRules: {
                    'name': [
                        { required: true, message: '请填写商品类目' }
                    ]
                }
            }
        },
        methods: {
            // 提交
            onSubmit() {

            }

        }

    }
</script>

<style scoped>

</style>